//
// Created by Zsir on 2025/7/25.
//

#ifndef THREAD_THREAD_H
#define THREAD_THREAD_H

#include <pthread.h>
#include "functional"

class threadPool;

class Thread
{
public:
    using Func = std::function<void(void *)>;

    explicit Thread(threadPool *pool);

    ~Thread();

    void start();

    void stop();

private:
    static void *run(void *arg);
    bool running_;
    pthread_t threadId_;
    threadPool *pool_;
};


#endif //THREAD_THREAD_H
